/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MainFormView.java
 *
 * Created on 27.05.2013, 15:17:11
 */
package db21;

import java.awt.event.MouseEvent;
import javax.swing.JButton;

/**
 *
 * @author Mamontov
 */
public class MainFormView extends ApplicationPanel {

   
    
    /** Creates new form MainFormView */
    public MainFormView() {
        initComponents();
        JButton btns[] = { btnResources, btnCollections, btnSeekResources, 
                           btnCompetences, btnSubjects, btnThemes, btnConsole};
        ApplicationMode modes[] = {
            ApplicationMode.EducationalResources,
            ApplicationMode.Collections,
            ApplicationMode.SeekResources,
            ApplicationMode.Competences,
            ApplicationMode.Subjects,
            ApplicationMode.Themes,
            ApplicationMode.Console
        };
        for(int i = 0; i < btns.length; i++) {
            this.bindOnClickListenerTogglingToMode(btns[i], modes[i]);
        }
        
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        btnResources = new javax.swing.JButton();
        btnCollections = new javax.swing.JButton();
        btnSeekResources = new javax.swing.JButton();
        btnCompetences = new javax.swing.JButton();
        btnThemes = new javax.swing.JButton();
        btnSubjects = new javax.swing.JButton();
        btnConsole = new javax.swing.JButton();

        btnResources.setText("Обучающие ресурсы");
        btnResources.setName("btnResources"); // NOI18N
        btnResources.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnResourcesActionPerformed(evt);
            }
        });

        btnCollections.setText("Коллекции");

        btnSeekResources.setText("Поиск ресурсов");

        btnCompetences.setText("Компетенции");

        btnThemes.setText("Темы");

        btnSubjects.setText("Предметы");

        btnConsole.setText("Консоль");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(btnCompetences, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnSeekResources, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnCollections, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnResources, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(btnThemes, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)
                    .addComponent(btnSubjects, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)
                    .addComponent(btnConsole, javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btnResources)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnCollections)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnSeekResources)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnCompetences)
                .addGap(5, 5, 5)
                .addComponent(btnSubjects)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnThemes)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnConsole)
                .addContainerGap(34, Short.MAX_VALUE))
        );

        btnCollections.getAccessibleContext().setAccessibleName("btnCollections");
    }// </editor-fold>//GEN-END:initComponents

    private void btnResourcesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnResourcesActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_btnResourcesActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCollections;
    private javax.swing.JButton btnCompetences;
    private javax.swing.JButton btnConsole;
    private javax.swing.JButton btnResources;
    private javax.swing.JButton btnSeekResources;
    private javax.swing.JButton btnSubjects;
    private javax.swing.JButton btnThemes;
    // End of variables declaration//GEN-END:variables
}
